package staticproxy;


/**
 * @author gaopeng
 * @date 2019/12/8 7:22 下午
 */
public class GamePlayerProxy implements IGamePlayer {
    private IGamePlayer gamePlayer;

    public GamePlayerProxy(String name) {
        this.gamePlayer = new GamePlayer(name);
    }

    @Override
    public void login(String name, String password) {
        gamePlayer.login(name,password);
    }

    @Override
    public void killBoss() {
        before();
        gamePlayer.killBoss();
        after();
    }

    @Override
    public void upgrade() {
        gamePlayer.upgrade();
    }

    private void before(){
        System.out.println("before");
    }

    private void after(){
        System.out.println("after");
    }
}
